package com.t235.gc.goods.service;

import com.t235.gc.entity.GoodsCategory;
import com.t235.gc.goods.Dao.GoodsCategoryMapper;
import com.t235.gc.goods.Dao.GoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsService {
    @Autowired
    private GoodsCategoryMapper goodsCategoryMapper;
    @Autowired
    private GoodsMapper goodsMapper;

    public List<GoodsCategory> find(String goodsCategoryName) {
        return goodsCategoryMapper.goodPage(goodsCategoryName);
    }

    public Object save(GoodsCategory goodsCategory) {
        return goodsCategoryMapper.insert(goodsCategory);
    }

    public Object update(Long goodsCategoryId){
        return goodsCategoryMapper.update(goodsCategoryId);
    }

    public Object del(Long goodsCategoryId){
        return goodsMapper.del(goodsCategoryId);
    }

    public Object upd(String goodsCategoryName,String goodsCategoryId) {
        return goodsCategoryMapper.upd(goodsCategoryId,goodsCategoryName);
    }
}
